package com.linxz.framework.protocol.resp;

import android.text.TextUtils;

/**
 * @author Linxz
 * 创建日期：2019年02月20日 20:14
 * version：1.0.0
 * 描述：
 */
public class BaseBean<T> {
    private String code;
    private String msg;
    private T data;

    //wanAndroidAPI
    private int errorCode;
    private String errorMsg;

    public String getStatus() {
        return code;
    }

    public void setStatus(String status) {
        this.code = status;
    }

    public String getMsg() {
        if (!TextUtils.isEmpty(errorMsg)){
            return errorMsg;
        }
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isOk(){
        return "200".equals(code);
    }

    public boolean authError(){
        return "202".equals(code);
    }


    public Integer getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
